package com.tfy.liquor.service.impl;

import com.tfy.liquor.bean.FreightRegion;
import com.tfy.liquor.dao.FreightRegionDao;
import com.tfy.liquor.service.FreightRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class FreightRegionServiceImpl implements FreightRegionService {
    @Autowired
    private FreightRegionDao freightRegionDao;

    // 获取全部省级地址信息
    @Override
    public ArrayList<FreightRegion> getProvinceFreightRegion() {
        return freightRegionDao.getProvinceFreightRegion();
    }

    // 根据父级编号获取下级地址信息
    @Override
    public ArrayList<FreightRegion> getFreightRegionByPid(int pid) {
        return freightRegionDao.getFreightRegionByPid(pid);
    }

    // 添加行政区域地址信息
    @Override
    public Boolean addFreightRegion(FreightRegion freightRegion) {
        return freightRegionDao.addFreightRegion(freightRegion) > 0;
    }
}
